package com.mz.ozy.activity.me;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;

import com.mz.ozy.R;
import com.mz.ozy.base.BaseActivity;
import com.mz.ozy.bean.AccountBean;
import com.mz.ozy.bean.MeBean;
import com.mz.ozy.bean.NewCheckJoinMemberBean;
import com.mz.ozy.bean.NewResponeBean;
import com.mz.ozy.bean.UnreadMsgBean;
import com.mz.ozy.mvp.presenter.MePresenter;
import com.mz.ozy.mvp.view.MeContract;

import org.json.JSONObject;

import butterknife.BindView;
import butterknife.ButterKnife;

public class CustomServiceActivity extends BaseActivity<MeContract.View, MePresenter> implements MeContract.View {


    @BindView(R.id.webview)
    WebView webview;

    public static void go(Context aboutMeActivity, int i) {
        Intent intent = new Intent(aboutMeActivity, CustomServiceActivity.class);
        intent.putExtra("type", i);
        aboutMeActivity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_service);
        ButterKnife.bind(this);
        initTitle();

        int type = getIntent().getIntExtra("type", 0);
        if (type == 0) {
            tvCenterTitle.setText("用户协议");
        } else {
            tvCenterTitle.setText("隐私政策 ");
        }
        mPresenter.getxi(this, type + "");


    }


    @Override
    public void getgetMeInfoSuccess(MeBean bean) {

    }

    @Override
    public void getAccountSuccess(AccountBean bean) {

    }

    @Override
    public void uploadHeaderSuccess(JSONObject bean) {

    }

    @Override
    public void getxySuccess(MeBean bean) {
        try {

            webview.loadDataWithBaseURL(null, bean.getContent(), "text/html", "utf-8", null);
        } catch (Exception e) {
            e.printStackTrace();

        }
    }

    @Override
    public void bindInfo(String type, JSONObject bean) {
    }

    @Override
    public void getAliSuccess(MeBean bean) {
    }

    @Override
    public void exitLoginSuccess(JSONObject bean) {
    }

    @Override
    public void onCancelBindSuccess() {
    }

    @Override
    public void getUnreadMsgSuccess(UnreadMsgBean bean) {

    }

}
